<template>
  <div>  
   <ul>
     <li v-for=" item in data.songs">
       {{item.name}}
     </li>
   </ul>
  </div>
</template>
<script>
import {mapGetters} from 'vuex'
  export default {
      data () {
          return {
            data: []
          }           
      },
      computed: {
        // 使用对象展开运算符...将 getters 混入 computed 对象中
        ...mapGetters([
          'keyword',      
        ])
      },
      mounted () {        
        this.$requset.get(this.$Api.search,{keywords: this.keyword}).then((data) => {
          let {msg, code, result} = data
          if (code == 200) {
            this.data = result 
          }
        })
      },
      methods: {
        
      }
  }
</script>
